package it.low.game.server;

import it.low.game.core.element.ActiveElement;

import java.util.HashMap;
import java.util.Map;

public class ServerStoring {

	private static Map<String, ActiveElement> elementPlayers = new HashMap<String, ActiveElement>();
	private static Map<String, ActiveElement> elementBots = new HashMap<String, ActiveElement>();
	
	// LOAD BACKGROUND IMAGES
	private static String bgImage_ground_0_C = new String("images/map/background/ground_0.jpg");
	private static String bgImage_ground_1_N = new String("images/map/background/ground_1_N.jpg");
	private static String bgImage_ground_1_S = new String("images/map/background/ground_1_S.jpg");
	
	private static String[][] mapDescription = null;
	
	public static void init(){
		// INIZIALIZZAZIONE DELLA MAPPA
		mapDescription = new String[3][4];		
		mapDescription[0][0] = bgImage_ground_1_N;
		mapDescription[1][0] = bgImage_ground_1_N;
		mapDescription[2][0] = bgImage_ground_1_N;
		mapDescription[0][1] = bgImage_ground_0_C;			
		mapDescription[1][1] = bgImage_ground_0_C;
		mapDescription[2][1] = bgImage_ground_0_C;
		mapDescription[0][2] = bgImage_ground_0_C;			
		mapDescription[1][2] = bgImage_ground_0_C;
		mapDescription[2][2] = bgImage_ground_0_C;
		mapDescription[0][3] = bgImage_ground_1_S;			
		mapDescription[1][3] = bgImage_ground_1_S;
		mapDescription[2][3] = bgImage_ground_1_S;
		
		// INIZIALIZZAZIONE DEI BOT
		
		
		// INIZIALIZZAZIONE DEI PLAYERS
		ActiveElement player1 = new ActiveElement("player1","Axel","images/player/hero.png");
		player1.setProperty(ActiveElement.MOV_SPEED, 0.1);
		player1.setProperty(ActiveElement.RUN_SPEED, 0.1);
		player1.setProperty(ActiveElement.SIG_RANGE, 200);
		player1.setProperty(ActiveElement.ATT_RANGE, 0);
		elementPlayers.put("player1", player1);
		
		ActiveElement player2 = new ActiveElement("player2","Rey","images/player/hero.png");
		player2.setProperty(ActiveElement.MOV_SPEED, 0.1);
		player2.setProperty(ActiveElement.RUN_SPEED, 0.1);
		player2.setProperty(ActiveElement.SIG_RANGE, 200);
		player2.setProperty(ActiveElement.ATT_RANGE, 0);
		elementPlayers.put("player2", player2);
	}	
	
	public static ActiveElement getElementPlayer(String id){
		return elementPlayers.get(id);
	}
	
	public static String[][] getMapDecription(){
		return mapDescription;
	}
	
}
